import 'package:intl/intl.dart';
import 'package:web_socket_channel/io.dart';
import 'package:web_socket_channel/status.dart' as status;

class Connector {
  late IOWebSocketChannel channel;
  late String name;
  final String serverUrl;

  Connector(this.serverUrl) {
  }

  void connect() {
    channel = IOWebSocketChannel.connect(serverUrl);
  }

  void send(String msg) {
      channel.sink.add(msg);
  }

  void close() {
    channel.sink.close();
  }
}
